﻿<Window x:Class="CannedBytes.CommandLineGui.UI.MainWindow" x:ClassModifier="internal"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ui="clr-namespace:CannedBytes.CommandLineGui.UI"
        Title="Commandline Gui" Height="450" Width="800"
        WindowStartupLocation="CenterScreen">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <ui:Toolbar />

        <!-- this displays the document pages -->
        <TabControl Name="Documents" Grid.Row="1"
                    ItemsSource="{Binding Documents, Mode=OneWay}" TabStripPlacement="Left"
                    SelectedItem="{Binding ActiveDocument, Mode=TwoWay}">
            <TabControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Label Name="ToolGuiName" Content="{Binding Path=ToolInfo.Tool.Gui.Name, Mode=OneTime}" />
                        <Image Source="/CannedBytes.CommandLineGui;component/Resources/Save.png" Width="16" Height="16"
                               Visibility="{Binding Path=IsChanged, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                               ToolTip="The document has changed and needs to be saved."/>
                    </StackPanel>
                </DataTemplate>
            </TabControl.ItemTemplate>
        </TabControl>
    </Grid>
</Window>